Skip to content

fix(oauth): accept token_rotation_expiration_minutes in AsyncOAuthFlow.sqlite3 - #1625

Open
pcbeingused333 wants to merge 3 commits into
slackapi:mainfrom
pcbeingused333:fix/async-oauth-sqlite3-token-rotation
Open

pcbeingused333 wants to merge 3 commits into
slackapi:mainfrom
pcbeingused333:fix/async-oauth-sqlite3-token-rotation

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Nov 14, 2026 •

Copy link
Copy Markdown

Follow-up to #1625, addressing WilliamBergamin's requested changes.

Move token_rotation_expiration_minutes after logger in AsyncOAuthFlow.sqlite3() so existing positional client and logger arguments retain their positions. Also assert that the configured expiration reaches settings.authorize, as suggested in the review. The synchronous factory is unchanged because this follow-up corrects only the newly introduced async signature.

Testing

The SQLite3 OAuth tests pass (6), including the new settings.authorize assertion, and a signature check confirms client and logger keep their positions. Formatting and lint pass.

This follow-up was prepared with an AI coding assistant (Codex).

…w.sqlite3

OAuthFlow.sqlite3() exposes token_rotation_expiration_minutes and forwards
it to OAuthSettings, but the async factory did not, so the value could not
be customized without building AsyncOAuthSettings by hand.

Signed-off-by: Alex Castillo <alex.castillog33@gmail.com>
@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 14, 2026 17:55
@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @pcbeingused333 to sign the Salesforce Inc. Contributor License Agreement.

@mwbrooks mwbrooks added bug Something isn't working area:async semver:patch labels Nov 15, 2026
@mwbrooks mwbrooks added this to the next milestone Nov 15, 2026

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Thanks @pcbeingused333, welcome to bolt-python!

# Installation Management
installation_store=installation_store,
installation_store_bot_only=installation_store_bot_only,
token_rotation_expiration_minutes=token_rotation_expiration_minutes,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Nice catch on the async factory drifting from the sync one! Matching the default and position keeps the two signatures easy to compare 🙌

@mwbrooks

Copy link
Copy Markdown
Member

@pcbeingused333 Could you sign the Salesforce CLA? We need it signed before we can continue with this PR. 🙏

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.57%. Comparing base (1ab319e) to head (c3dfb31).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1625   +/-   ##
=======================================
  Coverage   91.57%   91.57%           
=======================================
  Files         228      228           
  Lines        7285     7285           
=======================================
  Hits         6671     6671           
  Misses        614      614           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@WilliamBergamin WilliamBergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this 💯

I think the change in positional agreement is a breaking change once addressed I think we can merge this 🙏

Comment thread slack_bolt/oauth/async_oauth_flow.py Outdated
Comment on lines 116 to 118
token_rotation_expiration_minutes: int = 120,
client: Optional[AsyncWebClient] = None,
logger: Optional[Logger] = None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚦 suggestion (blocking): Could this go after logger instead? Placing it before client and logger shifts their positions for anyone passing them positionally, while appending keeps it a pure addition.

Suggested change
token_rotation_expiration_minutes: int = 120,
client: Optional[AsyncWebClient] = None,
logger: Optional[Logger] = None,
client: Optional[AsyncWebClient] = None,
logger: Optional[Logger] = None,
token_rotation_expiration_minutes: int = 120,

scopes=["chat:write", "commands"],
token_rotation_expiration_minutes=30,
)
assert oauth_flow.settings.token_rotation_expiration_minutes == 30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 suggestion (non-blocking): Could we also assert on settings.authorize? That's the value the app actually uses to refresh tokens.

Suggested change
assert oauth_flow.settings.token_rotation_expiration_minutes == 30
assert oauth_flow.settings.token_rotation_expiration_minutes == 30
assert oauth_flow.settings.authorize.token_rotation_expiration_minutes == 30

Address the positional compatibility review on slackapi#1625 and assert the expiration is forwarded to the authorizer.
@pcbeingused333

Copy link
Copy Markdown
Author

Moved the parameter after logger to preserve existing positional arguments and added the assertion on settings.authorize.token_rotation_expiration_minutes. The six SQLite3 OAuth tests pass.

This comment was drafted with Claude Code.

@WilliamBergamin

Copy link
Copy Markdown
Contributor

@pcbeingused333 have you signed the CLA?

@pcbeingused333

Copy link
Copy Markdown
Author

The Salesforce CLA was signed on November 16, but the salesforce-cla check is still reporting a failure. Could you please recheck the CLA status for this PR and let us know if anything else is needed?

This comment was drafted with an AI coding assistant (Codex).

@WilliamBergamin

Copy link
Copy Markdown
Contributor

Closing and reopening the PR forces a recheck of the CLA status by the checker and it reports that you're account has not signed it

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants